<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUsuarioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_id}" for="id" />
                    <h:inputText id="id" value="#{usuarioController.selected.id}" title="#{bundle.CreateUsuarioTitle_id}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_login}" for="login" />
                    <h:inputText id="login" value="#{usuarioController.selected.login}" title="#{bundle.CreateUsuarioTitle_login}" />
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{usuarioController.selected.nome}" title="#{bundle.CreateUsuarioTitle_nome}" />
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_senha}" for="senha" />
                    <h:inputText id="senha" value="#{usuarioController.selected.senha}" title="#{bundle.CreateUsuarioTitle_senha}" />
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_EMail}" for="EMail" />
                    <h:inputText id="EMail" value="#{usuarioController.selected.EMail}" title="#{bundle.CreateUsuarioTitle_EMail}" />
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_idTipoUsuario}" for="idTipoUsuario" />
                    <h:selectOneMenu id="idTipoUsuario" value="#{usuarioController.selected.idTipoUsuario}" title="#{bundle.CreateUsuarioTitle_idTipoUsuario}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_idTipoUsuario}">
                        <f:selectItems value="#{tipoUsuarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_coletor}" for="coletor" />
                    <h:selectOneMenu id="coletor" value="#{usuarioController.selected.coletor}" title="#{bundle.CreateUsuarioTitle_coletor}" >
                        <f:selectItems value="#{coletorController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_administrador}" for="administrador" />
                    <h:selectOneMenu id="administrador" value="#{usuarioController.selected.administrador}" title="#{bundle.CreateUsuarioTitle_administrador}" >
                        <f:selectItems value="#{administradorController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{usuarioController.create}" value="#{bundle.CreateUsuarioSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{usuarioController.prepareList}" value="#{bundle.CreateUsuarioShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateUsuarioIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
